#include "FerrisWheel.h"
#include "World.h"

FerrisWheel::FerrisWheel(World& i_world, EFerrisWheelType i_type)
  : m_world(i_world),
  m_state(0)
  {
  switch (i_type)
    {
    case FWT_DEFAULT_FERRIS_WHEEL:
      m_type = "DEFAULT_FERRIS_WHEEL_0";
      m_name = m_type + " " + std::to_string(m_id_cnt++);
      m_state = 0;
      break;
    default:
      break;
    }

  m_world.AddRenderable(this);
  m_world.AddAnimated(this);
  }

void FerrisWheel::NextFrame()
  {
  switch (m_state)
    {
    case 0:
      m_state = 1;
      m_type = "DEFAULT_FERRIS_WHEEL_1";
      break;
    case 1:
      m_state = 2;
      m_type = "DEFAULT_FERRIS_WHEEL_2";
      break;
    case 2:
      m_state = 0;
      m_type = "DEFAULT_FERRIS_WHEEL_0";
      break;
    default:
      break;
    }
  }

std::string FerrisWheel::GetName() const
	{
	return WorldObject::GetName();
	}

FerrisWheel::~FerrisWheel()
  {
  m_world.RemoveRenderable(this);
  m_world.RemoveAnimated(this);
  }